VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "KEW_PassWord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Private WithEvents m_BillInterface  As BillEvent
Attribute m_BillInterface.VB_VarHelpID = -1


Public Sub Show(ByVal oBillInterface As Object)
    Set m_BillInterface = oBillInterface
End Sub

Private Sub Class_Terminate()
    Set m_BillInterface = Nothing
End Sub



Private Sub m_BillInterface_MenuBarClick(ByVal BOSTool As K3ClassEvents.BOSTool, Cancel As Boolean)
    Select Case BOSTool.ToolName
    Case "kewBuild":
        m_BillInterface.DeleteEntryData 2
        GetPassWord m_BillInterface.GetFieldValue("FInteger")
    End Select
End Sub



Public Function GetPassWord(ByVal count As Integer) As Dictionary
    Dim passwordlist As New Dictionary
    Dim temp As String
    Dim i As Integer
    i = 0
    While i < count
        Randomize
        temp = Right("000000" & Int(Rnd * 999999), 6)
        If Not passwordlist.Lookup(temp) Then
            i = i + 1
            passwordlist(temp) = i
            m_BillInterface.InsertNewRowAndFill 2, i, "FText", temp
        End If
    Wend
    Set passwordlist = Nothing
End Function
